import data
from data import Data
import kivy
from kivy.core.audio import SoundLoader

class PublicData (): #为各个屏幕构建公用数据
    def __init__(self) -> None:
        self.UserData = None
        self.DiaryData = None
        self.FridgeMagnetData = None
        self.QuestionData = None
        self.u_identity = 0
        self.OM = Data.ObjMemory()
        self.BGM = SoundLoader.load('./music/BGM.wav')
        self.button_clicked = SoundLoader.load('./music/button.wav')
        self.BGM.volume = 0.1

        self.UserData = self.OM.LoadObj('./data/UserData.pkl')
        self.DiaryData = self.OM.LoadObj('./data/DiaryData.pkl')
        self.FridgeMagnetData = self.OM.LoadObj('./data/FridgeMagnetData.pkl')
        self.QuestionData = self.OM.LoadObj('./data/QuestionData.pkl')